# Maintainer: André Klitzing <aklitzing@gmail.com>
# Contributor: André Klitzing <aklitzing@gmail.com>
pkgname=clazy
pkgver=1.11
pkgrel=7
pkgdesc="Qt oriented code checker based on clang framework"
url="https://invent.kde.org/sdk/clazy"
arch="all"
license="LGPL-2.0-only"
_llvmver=16
makedepends="
	clang$_llvmver-dev
	cmake
	llvm$_llvmver-dev
	perl
	samurai
	"
options="!check" # cannot run tests without installation
subpackages="$pkgname-doc"
source="https://download.kde.org/stable/clazy/$pkgver/src/clazy-$pkgver.tar.xz
	clang15-libs.patch
	clang16-libs.patch
	"

build() {
	cmake -B build -G Ninja \
		-DLLVM_ROOT=/usr/lib/llvm$_llvmver \
		-DLLVM_CONFIG_EXECUTABLE=/usr/lib/llvm$_llvmver/bin/llvm-config \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6a7c162392dd30aea29669275cea814d6daccf7931b8cdb20997f9bbff5619832d5461a6d0f854ecbc4726e52b6937c4f9cb8651087ffe73676c04239a38ca2b  clazy-1.11.tar.xz
eaea55817d3b5d8476b4ffc9de42bf4de87b24f0b428dd0b8df0dadbb5f4bcaa927cdc0798ba8ffeeef584eff3b701d96d5e29cc2be8ff28919263fe0334048c  clang15-libs.patch
8a20746c71dab10d6c10c2d8dfc65da964cd5a52c1ac2194e3c6da1ff6430f9689288086f763d18cb496a1195492049450639bbfad5b621153f718e27e755b93  clang16-libs.patch
"
